// 创建路由

import {createRouter,createWebHistory,createWebHashHistory} from 'vue-router'
import About from '@/pages/About.vue'
import Home from '@/pages/Home.vue'
import News from '@/pages/News.vue'
import Detail from '@/pages/Detail.vue'
const router = createRouter({
    history:createWebHistory(),//工作模式
    routes:[
        {
            name:'MyHome',
            path:'/home',
            component:Home
        },
        {
            name:'MyAbout',
            path:'/about',
            component:About
        },
        {
            name:'MyNews',
            path:'/news',
            component:News,
            children:[
                {
                    name:'MyDetail',
                    path:'detail/:id/:title/:content',
                    component:Detail
                }
            ]
        },
    ]
})

export default router